<?php

class ShopVurlBehavior extends CActiveRecordBehavior{

	public $route = 'shop/goods/{type}View';
	
	/**
	 * 店铺商品详情
	 * Enter description here ...
	 */
	public function getSVurl() {
		$route = str_ireplace('{type}', strtolower($this->owner->attributes['object_type']), $this->route);
		return Yii::app()->createUrl($route,array('id'=>$this->owner->primaryKey,'uid'=>@$_GET['uid']));
	}
	
	/**
	 * 供应商店铺
	 * Enter description here ...
	 */
	public function getPShop() {
		return Yii::app()->createUrl('shop/index/index',array('uid'=>CHtml::value($this->owner, 'provider_id')));
	}
}

?>